package SHNOPData
{
	import SHNOPData.UserInfo;
	
	import cn.org.rapid_framework.flex_security.SecurityControler;
	
	import mx.collections.ArrayCollection;

	public class UserMgr
	{
		
		private static var userInfo:UserInfo;
		private static var dicList:ArrayCollection;
		private static var menuList:ArrayCollection;
		public function UserMgr()
		{
		}
		
		public static function SetUser(user:UserInfo):void{
			userInfo=user;
		}
		public static function Getuser():UserInfo{
			return userInfo;
			
		}
		public static function setUserMenuList(menuList2:ArrayCollection):void{
			 menuList=menuList2;
		}
		public static function getUserMenuList():ArrayCollection{

			return menuList;
		}
		public static function SetDicList(dicList2:ArrayCollection):void{
			dicList=dicList2;
		}
		public static function GetDicListByName(name:String):ArrayCollection{
			var dicListByName:ArrayCollection=new ArrayCollection();
			for each(var obj:Object in dicList){
				if(obj.ParentName==name){
					dicListByName.addItem(obj);
				}
			}
			return dicListByName;
			
		}
		public static function setPrivate():void
		{
			var mainList:ArrayCollection=getUserMenuList();
			SecurityControler.start(null,"all");
			
			SecurityControler.addPerm("btnM_NetworkPlan");
			SecurityControler.addPerm("btnM_building");
			for each (var obj:Object in mainList) 
			{
				SecurityControler.addPerm(obj.menu_Id);
			}
		}
	}
}